import { defineStore } from 'pinia';
import { ref } from 'vue';
import type { CommandSender } from '../commandHelper';

type SendCalibrationCmd = CommandSender<any, any> | null;

// 1. 先按原来的方式定义Store（完全不变）
export const useCalibrationStore = defineStore('calibrationInjection', () => {
  const sendCalibrationCmd = ref<SendCalibrationCmd>(null);

  const setInjections = (injections: { sendCalibrationCmd?: SendCalibrationCmd }) => {
    if (injections.sendCalibrationCmd) {
      sendCalibrationCmd.value = injections.sendCalibrationCmd;
    }
  };

  return { sendCalibrationCmd, setInjections };

});